I finally solved this mystery, so here is the answer for anyone else who has this problem.
My MIDI keyboard for some nonsensical reason outputs on multiple channels at once. This causes duplicate notes to be sent to HISE which causes the group counter to increase twice for each key press. So the solution is to filter the incoming MIDI channel in HISE preferences.